package com.test.quartz.jdbc.config;

import com.test.quartz.memory.job.Job1;
import org.quartz.*;
import org.springframework.context.annotation.Bean;

//@Configuration
public class QuartConfig1 {

    @Bean
    public JobDetail jobDetail1(){
        JobDetail jodDetail = JobBuilder.newJob(Job1.class)
                .withIdentity("job1", "group1")
                .storeDurably()
                .build();
        return jodDetail;
    }

    @Bean
    public Trigger trigger1(){
        Trigger trigger = TriggerBuilder.newTrigger()
                .withIdentity("trigger1", "group1")
                .forJob(jobDetail1())
                .startNow()
                .withSchedule(CronScheduleBuilder.cronSchedule("0/3 * * * * ?"))
                .build();
        return trigger;
    }

}
